package com.snda.photo.service.service;

import com.snda.commons.servicegate.annotations.Service;
import com.snda.commons.servicegate.annotations.Endpoint;
import com.snda.commons.servicegate.annotations.Param;
import com.snda.photo.service.dto.AlbumDto;
import com.snda.photo.service.dto.ExifDto;
import com.snda.photo.service.dto.ImageDto;
import com.snda.photo.service.dto.PhotoDto;
import com.snda.relation.service.opensocial.GetResponse;
import com.snda.relation.service.opensocial.UpdateResponse;
@Service("photoService")
public interface PhotoService {
	
	//***************************************************
	//*					相册
	//***************************************************
	/**
	 * 创建相册
	 * @param sdid
	 * @param appId
	 * @param maxCapacity
	 * @param name
	 * @param description
	 * @return
	 * @throws Exception
	 */
	@Endpoint(alias = "createPhoto")
	GetResponse<PhotoDto> createPhoto(
			@Param(value = "sdid")  long sdid,					//SDID
			@Param(value = "appId") long appId,														//应用ID
			@Param(value = "maxCapacity",optional = true, defaultValue = "0") long  maxCapacity,	//容量,单位K
			@Param(value = "name",optional = true) String name,										//相册名称
			@Param(value = "description",optional = true) String description						//相册描述
		);
	
	@Endpoint(alias = "updatePhoto")
	UpdateResponse updatePhoto(
			@Param(value = "id")  long id,	
			@Param(value = "sdid")  long sdid,
			@Param(value = "maxCapacity",optional = true, defaultValue = "0") long  maxCapacity,	//容量,单位K
			@Param(value = "name",optional = true) String name,										//相册名称
			@Param(value = "description",optional = true) String description						//相册描述		
		);

	@Endpoint(alias = "getPhoto")
	GetResponse<PhotoDto> getPhoto(
			@Param(value = "id",optional = true, defaultValue="0")  long id,
			@Param(value = "sdid")  long sdid,
			@Param(value = "appId",optional = true)  long[] appId
		);

	
	//***************************************************
	//*					专辑
	//***************************************************
	@Endpoint(alias = "createAlbum")
	GetResponse<AlbumDto> createAlbum(
			@Param(value = "photoId") long photoId,													//相册ID
			@Param(value = "sdid")  long sdid,														//SDID
			@Param(value = "name",optional = true) String name,										//专辑名称
			@Param(value = "description",optional = true) String description,						//专辑描述
			@Param(value = "privilege",optional = true, defaultValue="0") int privilege,			//浏览权限
			@Param(value = "shareable",optional = true) Boolean shareable,							//是否可分享
			@Param(value = "reviewable",optional = true) Boolean reviewable							//是否可评论
		);
	
	@Endpoint(alias = "deleteAlbum")
	UpdateResponse deleteAlbum(
			@Param(value = "id")  long id,															//id
			@Param(value = "sdid")  long sdid														//sdid
		);
	
	@Endpoint(alias = "updateAlbumCover")
	UpdateResponse updateAlbumCover(
			@Param(value = "id") long id,															//专辑ID
			@Param(value = "imageId")  long imageId,												//SDID
			@Param(value = "sdid") long sdid														//专辑名称
		);
	
	@Endpoint(alias = "updateAlbum")
	UpdateResponse updateAlbum(
			@Param(value = "id") long id,															//专辑ID
			@Param(value = "sdid")  long sdid,														//SDID
			@Param(value = "name",optional = true) String name,										//专辑名称
			@Param(value = "description",optional = true) String description,						//专辑描述
			@Param(value = "privilege",optional = true, defaultValue="0") int privilege,			//浏览权限
			@Param(value = "shareable",optional = true) Boolean shareable,							//是否可分享
			@Param(value = "reviewable",optional = true) Boolean reviewable							//是否可评论
		);

	@Endpoint(alias = "getAlbum")
	GetResponse<AlbumDto> getAlbum(
			@Param(value = "id",optional = true,defaultValue="0") long id, 				// photoId
			@Param(value = "photoId",optional = true,defaultValue="0") long photoId,	// photoId
			@Param(value = "appId",optional = true) long[] appId, 						// photoId
			@Param(value = "sdid") long sdid, 											// sdid
			
			@Param(value = "startIndex",optional = true,defaultValue="0") int startIndex,
			@Param(value = "itemsPerPage",optional = true,defaultValue="0")int itemsPerPage,
			@Param(value = "sortProperties",optional = true) String[] sortProperties,
			@Param(value = "sortTypes",optional = true) String[] sortTypes
	) ;
	
	//***************************************************
	//*					照片
	//***************************************************
	
	@Endpoint(alias = "addImage")
	GetResponse<ImageDto> addImage(
			@Param(value = "albumId") long albumId,									//专辑ID
			@Param(value = "sdid") long sdid,										//照片所有者sdid	
			@Param(value = "filePath") String filePath,								//照片文件路径
			@Param(value = "needStretch") Boolean needStretch,						//是否需要缩放
			@Param(value = "stretched") Boolean stretched,	  						//是否已经缩放			
			
			@Param(value = "name",optional = true) String name,						//照片名称,标题
			@Param(value = "description",optional = true) String description,		//照片描述
			@Param(value = "shareable",optional = true) Boolean shareable,			//可否分享
			@Param(value = "reviewable",optional = true) Boolean reviewable,		//可否评论
			@Param(value = "capacity") int capacity,//大小,kb
			@Param(value = "size",optional = true) String size,						//照片尺寸
			@Param(value = "uploadIp",optional = true) String uploadIp,				//上传ip			
			@Param(value = "tag",optional = true) String tag,						//暂时提供一个标签
			@Param(value = "location",optional = true) String location,				//地点
			@Param(value = "exif",optional = true) String exif						//exif
		);
	
	@Endpoint(alias = "deleteImage")
	UpdateResponse deleteImage(
			@Param(value = "id")  long id,											//id
			@Param(value = "sdid")	long sdid		 								//SDID
		);
	
	@Endpoint(alias = "updateImage")
	UpdateResponse updateImage(
			@Param(value = "id") long id,											//照片ID
			@Param(value = "sdid") long sdid,										//照片所有者sdid			
			
			@Param(value = "name",optional = true) String name,						//照片名称,标题
			@Param(value = "description",optional = true) String description,		//照片描述
			@Param(value = "shareable",optional = true) Boolean shareable,			//可否分享
			@Param(value = "reviewable",optional = true) Boolean reviewable,		//可否评论	
			@Param(value = "tag",optional = true) String tag,						//暂时提供一个标签
			@Param(value = "location",optional = true) String location				//地点

		);
	
	@Endpoint(alias = "getImage")
	GetResponse<ImageDto> getImage(
			@Param(value = "id", optional = true,defaultValue="0")  long id, 
			@Param(value = "albumId", optional = true,defaultValue="0")  long albumId, 
			@Param(value = "photoId", optional = true,defaultValue="0") long photoId,
			@Param(value = "appId",optional = true)  long[] appId, 
			@Param(value = "sdid") long sdid,
			
			@Param(value = "startIndex",optional = true,defaultValue="0") int startIndex,
			@Param(value = "itemsPerPage",optional = true,defaultValue="0")int itemsPerPage,
			@Param(value = "sortProperties",optional = true) String[] sortProperties,
			@Param(value = "sortTypes",optional = true) String[] sortTypes,
			@Param(value = "updateBrowseCount",optional = true)Boolean updateBrowseCount,			//是否增加浏览次数
			@Param(value = "itemsPerPage",optional = true,defaultValue="0")int requestRelation
			);
	
	@Endpoint(alias = "moveImage")
	UpdateResponse moveImage(
			@Param(value = "imageId")  long imageId, 
			@Param(value = "sdid") long sdid,
			@Param(value = "destAlbumId") long destAlbumId
			);
	
	@Endpoint(alias = "addExif")
	UpdateResponse addExif(
			@Param(value = "imageId")  long imageId,
			@Param(value = "sdid")  long sdid,
			@Param(value = "exif") long exif
			);
	
	@Endpoint(alias = "getExif")
	GetResponse<ExifDto> getExif(
			@Param(value = "imageId")  long imageId,
			@Param(value = "sdid")  long sdid
			);
}
